<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
      <el-form-item label="数据编号" prop="dictName">
        <el-input
          v-model="queryParams.dictName"
          placeholder="请输入数据编号"
          clearable
          style="width: 240px"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="标准名称" prop="dictName">
        <el-input
          v-model="queryParams.dictName"
          placeholder="请输入标准名称"
          clearable
          style="width: 240px"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="备注" prop="dictType">
        <el-input
          v-model="queryParams.dictType"
          placeholder="请输入备注"
          clearable
          style="width: 240px"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="状态" prop="status">
        <el-select
          v-model="queryParams.status"
          placeholder="状态"
          clearable
          style="width: 240px"
        >
          <el-option
            v-for="item in statusOptions"
            :key="item.value"
            :label="item.label"
            :value="item.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="创建时间">
        <el-date-picker
          v-model="dateRange"
          style="width: 240px"
          value-format="yyyy-MM-dd"
          type="daterange"
          range-separator="-"
          start-placeholder="开始日期"
          end-placeholder="结束日期"
        ></el-date-picker>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['system:dict:add']"
        >新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['system:dict:edit']"
        >修改</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['system:dict:remove']"
        >删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['system:dict:export']"
        >导出</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-refresh"
          size="mini"
          @click="handleRefreshCache"
          v-hasPermi="['system:dict:remove']"
        >刷新缓存</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="dataList" @selection-change="handleSelectionChange"
              row-key="dataName">
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="数据编号" align="center" prop="id" />
      <el-table-column label="标准名称" align="center" prop="standardName" :show-overflow-tooltip="true"/>
      <el-table-column label="指标名称" align="center" prop="dataName" :show-overflow-tooltip="true" />
      <el-table-column label="值" align="center" prop="num" :show-overflow-tooltip="true" />
      <el-table-column label="状态" align="center" prop="status">
        <template slot-scope="scope">
          <!--          <dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/>-->
          <el-tag :type="getStatusTagType(scope.row.status)">{{ scope.row.status }}</el-tag>
        </template>
      </el-table-column>
      <el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true" />
      <el-table-column label="创建时间" align="center" prop="createTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.createTime) }}</span>
        </template>
      </el-table-column>
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['system:dict:edit']"
          >修改</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['system:dict:remove']"
          >删除</el-button>
<!--          <el-button-->
<!--            size="mini"-->
<!--            type="text"-->
<!--            icon="el-icon-search"-->
<!--            @click="handleView(scope.row)"-->
<!--            v-hasPermi="['system:dict:view']"-->
<!--          >查看</el-button>-->
          <!--            <router-link :to="'/datamanager/view/">-->
          <!--              <span>查看</span>-->
          <!--            </router-link>-->
          <el-button
            size="mini"
            type="text"
            icon="el-icon-time"
            @click="handlePath(scope.row)"
            v-hasPermi="['system:dict:path']"
          >跟踪</el-button>
        </template>
      </el-table-column>
    </el-table>

    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加数据对话框 -->
    <el-dialog :title="title" :visible.sync="isAddDialogOpen" width="500px" append-to-body>
      <el-upload
        ref="upload"
        :limit="1"
        accept=".zip"
        :headers="upload.headers"
        :action="upload.url"
        :disabled="upload.isUploading"
        :on-progress="handleFileUploadProgress"
        :on-success="handleFileSuccess"
        :auto-upload="false"
        drag
      >
        <i class="el-icon-upload"></i>
        <div class="el-upload__text">将文件拖到此处，或<em>点击上传</em></div>
        <div class="el-upload__tip text-center" slot="tip">
          <!--          <div class="el-upload__tip" slot="tip">-->
          <!--            <el-checkbox v-model="upload.updateSupport"/>-->
          <!--            是否更新已经存在的用户数据-->
          <!--          </div>-->
          <!--          <el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;"-->
          <!--                   @click="importTemplate">下载模板-->
          <!--          </el-link>-->
        </div>
      </el-upload>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <!--        <el-form-item label="字典名称" prop="dictName">-->
        <!--          <el-input v-model="form.dictName" placeholder="请输入字典名称" />-->
        <!--        </el-form-item>-->
        <!--        <el-form-item label="字典类型" prop="dictType">-->
        <!--          <el-input v-model="form.dictType" placeholder="请输入字典类型" />-->
        <!--        </el-form-item>-->
        <!--        <el-form-item label="状态" prop="status">-->
        <!--          <el-radio-group v-model="form.status">-->
        <!--            <el-radio-->
        <!--              v-for="dict in dict.type.sys_normal_disable"-->
        <!--              :key="dict.value"-->
        <!--              :label="dict.value"-->
        <!--            >{{dict.label}}</el-radio>-->
        <!--          </el-radio-group>-->
        <!--        </el-form-item>-->
        <!--        <el-form-item label="备注" prop="remark">-->
        <!--          <el-input v-model="form.remark" type="textarea" placeholder="请输入内容"></el-input>-->
        <!--        </el-form-item>-->
        <el-form-item label="数据名称" prop="status">
          <el-input v-model="form.dictName" placeholder="请输入数据名称" />
        </el-form-item>
        <el-form-item label="数据类型">
          <el-select
            v-model="value"
            placeholder="Select"
            size="large"
            style="width: 240px"
          >
            <el-option
              v-for="item in typeOptions"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            />
          </el-select>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>

    <!--修改对话框 -->
    <el-dialog :title="title" :visible.sync="isUpdateDialogOpen" width="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <!--        <el-form-item label="字典名称" prop="dictName">-->
        <!--          <el-input v-model="form.dictName" placeholder="请输入字典名称" />-->
        <!--        </el-form-item>-->
        <!--        <el-form-item label="字典类型" prop="dictType">-->
        <!--          <el-input v-model="form.dictType" placeholder="请输入字典类型" />-->
        <!--        </el-form-item>-->
        <!--        <el-form-item label="状态" prop="status">-->
        <!--          <el-radio-group v-model="form.status">-->
        <!--            <el-radio-->
        <!--              v-for="dict in dict.type.sys_normal_disable"-->
        <!--              :key="dict.value"-->
        <!--              :label="dict.value"-->
        <!--            >{{dict.label}}</el-radio>-->
        <!--          </el-radio-group>-->
        <!--        </el-form-item>-->

        <el-form-item label="修改值" prop="status">
          <el-input v-model="form.dictName" placeholder="请输入修改后的值" />
        </el-form-item>
<!--        <el-form-item label="备注" prop="remark">-->
<!--          <el-input v-model="form.remark" type="textarea" placeholder="请输入内容"></el-input>-->
<!--        </el-form-item>-->
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>

    <!-- 查看对话框-->
    <el-dialog :title="title" :visible.sync="isViewDialogOpen" width="500px" append-to-body>
      <el-table v-loading="loading" :data="dataList2" @selection-change="handleSelectionChange">
        <el-table-column label="编号" align="center" prop="id" />
        <el-table-column label="标准名称" align="center" prop="standardName" :show-overflow-tooltip="true" />
        <el-table-column label="总评结果" align="center" prop="accessResult":show-overflow-tooltip="true"></el-table-column>
      </el-table>
    </el-dialog>

    <!--跟踪对话框-->
    <el-dialog :title="title" :visible.sync="isPathDialogOpen" width="500px" append-to-body>
      <div class="timeline">
        <el-timeline>
          <el-timeline-item
            v-for="(item, index) in timelineData"
            :key="index"
            :timestamp="item.timestamp"
            :placement="index % 2 === 0 ? 'left' : 'right'"
            color="blue">
            {{ item.content }}
          </el-timeline-item>
        </el-timeline>
      </div>
    </el-dialog>
  </div>
</template>


<script>
  import { listMenu, getMenu, delMenu, addMenu, updateMenu } from "@/api/system/menu";
  import Treeselect from "@riophae/vue-treeselect";
  import "@riophae/vue-treeselect/dist/vue-treeselect.css";
  import IconSelect from "@/components/IconSelect";



  export default {
  name: "viewBaseStandard",
  dicts: ['sys_show_hide', 'sys_normal_disable'],
  components: { Treeselect, IconSelect },
  data() {
  return {
  // 遮罩层
  loading: true,
  activeName :'first',
  // 显示搜索条件
  showSearch: true,
  // 菜单表格树数据
  menuList: [],
  //表格
  dataList:[
{
  id:'1',
  dataName:'A标准制定过程影响力',
  standardName: 'ISO 7055',
  num:'92',
  status:'审核通过',
  remark:'1',
  createTime:'1001',
  children:[
    {
      dataName: 'A1参与主体影响力',
      id:'1',
      standardName: 'ISO 7055',
      num:'90',
      status:'审核通过',
      remark:'1',
      createTime:'1001',
      children:[
        {
          dataName: 'A11参与国家影响力',
          id:'1',
          standardName: 'ISO 7055',
          num:'87',
          status:'审核通过',
          remark:'1',
          createTime:'1001',
        },
        {
          dataName: 'A12参与企业/组织影响力(加分项)',
          id:'1',
          standardName: 'ISO 7055',
          num:'86',
          status:'审核通过',
          remark:'1',
          createTime:'1001',
        },
        {
          dataName: 'A13 起草人员（时间节点有待确定）',
          id:'1',
          standardName: 'ISO 7055',
          num:'93',
          status:'审核通过',
          remark:'1',
          createTime:'1001',
        },
      ]
    },
  ]
},
{
  id:'2',
  dataName:'B标准实施过程影响力',
  standardName: 'ISO 7055',
  num:'92',
  status:'审核通过',
  remark:'2',
  createTime:'1001',
  children:[
    {
      id:'2',
      dataName: 'B1标准应用',
      introduction:'',
      standardName: 'ISO 7055',
      num:'90',
      status:'审核通过',
      remark:'2',
      createTime:'1001',
      children:[
        {
          id:'2',
          dataName: 'B11 标准转化',
          introduction:'在TMB或者SMB成员国中转化为国家标准的数量',
          standardName: 'ISO 7055',
          num:'80',
          status:'审核通过',
          remark:'2',
          createTime:'1001',
        },
        {
          id:'2',
          dataName: 'B12其他标准引用',
          introduction:'标准被其他标准引用或者涉及的次数',
          standardName: 'ISO 7055',
          num:'70',
          status:'审核通过',
          remark:'2',
          createTime:'1001',
        },
        {
          id:'2',
          dataName: 'B13被法律法规引用',
          introduction:'在15个成员国中，被法律法规引用的比重，即在国家法律、强制性标准、技术法规或法令中被引用的比例',
          standardName: 'ISO 7055',
          num:'80',
          status:'审核通过',
          remark:'2',
          createTime:'1001',
        },
        {
          id:'2',
          dataName: 'B14 其他工程应用（加分项）',
          introduction:'在其他工程落地',
          standardName: 'ISO 7055',
          num:'85',
          status:'审核通过',
          remark:'2',
          createTime:'1001',
        },
      ]
    },
    {
      id:'2',
      dataName: 'B2市场推广',
      introduction:'',
      standardName: 'ISO 7055',
      num:'83',
      status:'审核通过',
      remark:'2',
      createTime:'1001',
      children:[
        {
          id:'2',
          dataName: 'B21标准传播',
          introduction:'标准销售量',
          standardName: 'ISO 7055',
          num:'87',
          status:'审核通过',
          remark:'2',
          createTime:'1001',
        },
        {
          id:'2',
          dataName: 'B22认证认可',
          introduction:'被全球认证所引用情况将根据认证类型的级别进行评估。',
          standardName: 'ISO 7055',
          num:'88',
          status:'审核通过',
          remark:'2',
          createTime:'1001',
        },
        {
          id:'2',
          dataName: 'B23标准关注度',
          introduction:'标准的查询（点击）',
          standardName: 'ISO 7055',
          num:'93',
          status:'审核通过',
          remark:'2',
          createTime:'1001',
        },
        {
          id:'2',
          dataName: 'B24 标准衍生材料传播（加分项）',
          introduction:'是否发行了相关标准衍生材料（包括通过视频等多种手段去传播、宣传标准等，具体范围需要专家界定 ）将影响评分，标准衍生材料是否在TMB 15个国家中发行',
          standardName: 'ISO 7055',
          num:'87',
          status:'审核通过',
          remark:'2',
          createTime:'1001',
        },
      ]
    },
    {
      id:'2',
      dataName: 'B3标准先进性',
      introduction:'',
      standardName: 'ISO 7055',
      num:'83',
      status:'审核通过',
      remark:'2',
      createTime:'1001',
      children:[
        {
          id:'2',
          dataName: 'B31标准引领性',
          introduction:'标准必要专利',
          standardName: 'ISO 7055',
          num:'87',
          status:'审核通过',
          remark:'2',
          createTime:'1001',
        },
        {
          id:'2',
          dataName: 'B32标准创新性',
          introduction:'标准被SCI/SSCI等数据库引用次数以及研究该项标准的论文数量。',
          standardName: 'ISO 7055',
          num:'83',
          status:'审核通过',
          remark:'2',
          createTime:'1001',
        },
        {
          id:'2',
          dataName: 'B33标准获奖（加分项）',
          introduction:'标准创新奖',
          standardName: 'ISO 7055',
          num:'90',
          status:'审核通过',
          remark:'2',
          createTime:'1001',
        },
      ]
    },
    {
      id:'2',
      dataName: 'B4社会效益',
      introduction:'',
      systemName:'国际标准影响力评估指标体系',
      standardName: 'ISO 7055',
      num:'85',
      status:'审核通过',
      remark:'2',
      createTime:'1001',
      children:[
        {
          id:'2',
          dataName: 'B41 社会关注度',
          introduction:'主要国家宣传报道次数，即TMB15个成员国标准化官网报道次数',
          standardName: 'ISO 7055',
          num:'87',
          status:'审核通过',
          remark:'2',
          createTime:'1001',
        },
        {
          id:'2',
          dataName: 'B42可持续发展支撑度',
          introduction:'可持续发展目标的关联数。',
          standardName: 'ISO 7055',
          num:'93',
          status:'审核通过',
          remark:'2',
          createTime:'1001',
        },
        {
          id:'2',
          dataName: 'B43对外贸易应用（国际贸易影响）',
          introduction:'是否在TBT和SPS中引用将直接影响评分',
          standardName: 'ISO 7055',
          num:'91',
          status:'审核通过',
          remark:'2',
          createTime:'1001',
        },
        {
          id:'2',
          dataName: 'B44产业扩散广度',
          introduction:'被多少个领域标准引用（不包括本领域），被其他领域标准引用的次数将根据分类号来区分领域',
          standardName: 'ISO 7055',
          num:'87',
          status:'审核通过',
          remark:'2',
          createTime:'1001',
        },
      ]
    },
  ]

},
// {
//   id:'3',
//   dataName:'指标3',
//   standardName: 'ISO 7055',
//   num:'92',
//   status:'审核通过',
//   remark:'3',
//   createTime:'1001',
//   children:[]
// },
// {
//   id:'4',
//   dataName:'指标4',
//   standardName: 'ISO 7055',
//   num:'92',
//   status:'审核失败',
//   remark:'4',
//   createTime:'1001',
//   children:[]
// },
// {
//   id:'5',
//   dataName:'指标5',
//   standardName: 'ISO 7055',
//   num:'92',
//   status:'待审核',
//   remark:'5',
//   createTime:'1001',
//   children:[]
// },
  ],
  dataList3:[
{
  id:'1',
  dataName:'标准1',
  remark:'1',
  createTime:'1001',
},
{
  id:'2',
  dataName:'标准2',
  remark:'2',
  createTime:'1001',
},
{
  id:'3',
  dataName:'标准3',
  remark:'3',
  createTime:'1001',
},
{
  id:'4',
  dataName:'标准4',
  remark:'4',
  createTime:'1001',
},
{
  id:'5',
  dataName:'标准5',
  remark:'5',
  createTime:'1001',
},
  ],
  // 菜单树选项
  menuOptions: [],
  // 弹出层标题
  title: "",
  // 新增对话框显示状态，默认为false
  isAddDialogOpen: false,
  // 修改对话框显示状态，默认为false
  isUpdateDialogOpen: false,
  // 查看对话框显示状态，默认为false
  isViewDialogOpen: false,
  // 跟踪对话框显示状态，默认为false
  isPathDialogOpen: false,
  // 新增对话框显示状态，默认为false
  isAddDialogOpen2: false,
  // 修改对话框显示状态，默认为false
  isUpdateDialogOpen2: false,
  // 查看对话框显示状态，默认为false
  isViewDialogOpen2: false,
  // 跟踪对话框显示状态，默认为false
  isPathDialogOpen2: false,
  // 是否展开，默认全部折叠
  isExpandAll: false,
  // 重新渲染表格状态
  refreshTable: true,
  //时间线数据
  timelineData: [
{ timestamp: '2015-09-01', content: '创建 by 用户1' },
{ timestamp: '2015-09-02', content: '修改 by 用户2' },
{ timestamp: '2015-09-03', content: '修改 by 用户3' },
{ timestamp: '2015-09-04', content: '修改 by 用户4' },
{ timestamp: '2015-09-05', content: '修改 by 用户5' },
{ timestamp: '2015-09-06', content: '修改 by 用户6' },
  // ...更多数据
  ],
  timelineData2: [
{ timestamp: '2015-09-01', content: '增加数据1 by 用户1' },
{ timestamp: '2015-09-02', content: '修改数据2 by 用户2' },
{ timestamp: '2015-09-03', content: '修改数据1 by 用户3' },
{ timestamp: '2015-09-04', content: '修改数据2 by 用户4' },
{ timestamp: '2015-09-05', content: '修改数据3 by 用户5' },
{ timestamp: '2015-09-06', content: '删除数据3 by 用户6' },
  ],
  // 查询参数
  queryParams: {
  menuName: undefined,
  visible: undefined
},
  // 表单参数
  form: {},
  //搜索的状态下拉框
  statusOptions : [
{
  value: '审核通过',
  label: '审核通过',
},
{
  value: '审核失败',
  label: '审核失败',
},
{
  value: '待审核',
  label: '待审核',
},
  ],
  //选择数据类型的下拉框
  typeOptions : [
{
  value: '标准文件',
  label: '标准文件',
},
{
  value: '补充文件',
  label: '补充文件',
},
  ],
  // 表单校验
  rules: {
  menuName: [
{ required: true, message: "菜单名称不能为空", trigger: "blur" }
  ],
  orderNum: [
{ required: true, message: "菜单顺序不能为空", trigger: "blur" }
  ],
  path: [
{ required: true, message: "路由地址不能为空", trigger: "blur" }
  ]
},
  dataList2:[
{
  id:'1',
  standardName: '指标1',
  accessResult:'92',
},
{
  id:'2',
  standardName: '指标2',
  accessResult:'92',
},
{
  id:'3',
  standardName: '指标3',
  accessResult:'92',
},
{
  id:'4',
  standardName: '指标4',
  accessResult:'92',
},
{
  id:'5',
  standardName: '指标5',
  accessResult:'92',
},
  ],
  // 用户导入参数
  upload: {
  // 是否禁用上传
  isUploading: false,
  // 是否更新已经存在的用户数据
  updateSupport: 0,
  // 设置上传的请求头部
  // headers: {Authorization: "Bearer " + getToken()},
  // 上传的地址
  url: process.env.VUE_APP_BASE_API + "/business/talkrecord/importAllRecords"//文件上传路径
},
};
},
  created() {
  this.getList();
},
  methods: {
  //标签页切换
  // handleTabClick(tab) {
  //   console.log('Tab clicked:', tab);
  // },
  // 选择图标
  selected(name) {
  this.form.icon = name;
},
  /** 获取状态 */
  getStatusTagType(status) {
  if (status === '审核通过') {
  return 'success';
} else if (status === '审核失败') {
  return 'danger';
} else if (status === '待审核') {
  return 'warning';
} else {
  return 'info';
}
},
  /** 查询菜单列表 */
  getList() {
  this.loading = true;
  listMenu(this.queryParams).then(response => {
  this.menuList = this.handleTree(response.data, "menuId");
  this.loading = false;
});
},
  /** 转换菜单数据结构 */
  normalizer(node) {
  if (node.children && !node.children.length) {
  delete node.children;
}
  return {
  id: node.menuId,
  label: node.menuName,
  children: node.children
};
},
  /** 查询菜单下拉树结构 */
  getTreeselect() {
  listMenu().then(response => {
  this.menuOptions = [];
  const menu = { menuId: 0, menuName: '主类目', children: [] };
  menu.children = this.handleTree(response.data, "menuId");
  this.menuOptions.push(menu);
});
},
  // 取消按钮
  cancel() {
  this.open = false;
  this.reset();
},
  // 表单重置
  reset() {
  this.form = {
  menuId: undefined,
  parentId: 0,
  menuName: undefined,
  icon: undefined,
  menuType: "M",
  orderNum: undefined,
  isFrame: "1",
  isCache: "0",
  visible: "0",
  status: "0"
};
  this.resetForm("form");
},
  /** 搜索按钮操作 */
  handleQuery() {
  this.getList();
},
  /** 重置按钮操作 */
  resetQuery() {
  this.resetForm("queryForm");
  this.handleQuery();
},

  /** 新增按钮操作 */
  handleAdd(row) {
  this.reset();
  this.getTreeselect();
  if (row != null && row.menuId) {
  this.form.parentId = row.menuId;
} else {
  this.form.parentId = 0;
}
  this.isAddDialogOpen = true;
  this.title = "添加菜单";
},
  /** 查看操作 */
  handleView(row){
  this.reset();
  this.getTreeselect();
  getMenu(row.id).then(response => {
  this.form = response.data;
  this.isViewDialogOpen = true;
  this.title = "";
});
},
  /** 跟踪操作 */
  handlePath(row){
  this.reset();
  this.getTreeselect();
  getMenu(row.id).then(response => {
  this.form = response.data;
  this.isPathDialogOpen = true;
  this.title = "";
});
},
  /** 新增按钮操作 */
  handleAdd2(row) {
  this.reset();
  this.getTreeselect();
  if (row != null && row.menuId) {
  this.form.parentId = row.menuId;
} else {
  this.form.parentId = 0;
}
  this.isAddDialogOpen2 = true;
  this.title = "添加菜单";
},
  /** 查看操作 */
  handleView2(row){
  // this.reset();
  // this.getTreeselect();
  // getMenu(row.id).then(response => {
  //   this.form = response.data;
  //   this.isViewDialogOpen2 = true;
  //   this.title = "";
  // });
  this.$router.push('/datamanager/viewBaseStandard');
  // this.$router.push('/');
},
  /** 跟踪操作 */
  handlePath2(row){
  this.reset();
  this.getTreeselect();
  getMenu(row.id).then(response => {
  this.form = response.data;
  this.isPathDialogOpen2 = true;
  this.title = "";
});
},
  /** 展开/折叠操作 */
  toggleExpandAll() {
  this.refreshTable = false;
  this.isExpandAll = !this.isExpandAll;
  this.$nextTick(() => {
  this.refreshTable = true;
});
},
  /** 修改按钮操作 */
  handleUpdate(row) {
  this.reset();
  this.getTreeselect();
  getMenu(row.id).then(response => {
  this.form = response.data;
  this.isUpdateDialogOpen = true;
  this.title = "修改菜单";
});
},
  /** 修改按钮操作 */
  handleUpdate2(row) {
  this.reset();
  this.getTreeselect();
  getMenu(row.id).then(response => {
  this.form = response.data;
  this.isUpdateDialogOpen2 = true;
  this.title = "修改菜单";
});
},
  /** 提交按钮 */
  submitForm: function() {
  this.$refs["form"].validate(valid => {
  if (valid) {
  if (this.form.menuId != undefined) {
  updateMenu(this.form).then(response => {
  this.$modal.msgSuccess("修改成功");
  this.open = false;
  this.getList();
});
} else {
  addMenu(this.form).then(response => {
  this.$modal.msgSuccess("新增成功");
  this.open = false;
  this.getList();
});
}
}
});
},
  /** 删除按钮操作 */
  handleDelete(row) {
  this.$modal.confirm('是否确认删除名称为"' + row.menuName + '"的数据项？').then(function() {
  return delMenu(row.menuId);
}).then(() => {
  this.getList();
  this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},

  // /** 文件上传操作 */
  // // 导出所有已经归档的谈话记录
  // importAllRecords() {
  //   this.upload.title = "导入归档的谈话记录";
  //   this.upload.open = true;
  //
  // },
  // // 文件上传中处理
  // handleFileUploadProgress(event, file, fileList) {
  //   this.upload.isUploading = true;
  // },
  // /** 下载模板操作 */
  // importTemplate() {
  //   this.download('system/user/importTemplate', {}, `user_template_${new Date().getTime()}.xlsx`)
  // },
  // // 文件上传成功处理
  // handleFileSuccess(response, file, fileList) {
  //   if (response.msg) {
  //     // this.fullscreenLoading = false;
  //     // this.upload.open = false;
  //     this.$modal.msgSuccess("成功导入：" + response.listsize + "条数据！");
  //   } else {
  //     // this.fullscreenLoading = false;
  //     // this.upload.open = false;
  //     this.$modal.msgSuccess("失败:" + response.errormsg);
  //   }
  //   this.upload.open = false;
  //   this.upload.isUploading = false;
  //   this.$refs.upload.clearFiles();
  //   // this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", {dangerouslyUseHTMLString: true});
  //   this.getList();
  // },
  // //点击确定上传后调取submit方法请求后台响应//找的就是上面url中定义的方法路径
  //
  // // 上传的地址 url: process.env.VUE_APP_BASE_API + "/business/talkrecord/importAllRecords"//文件上传路径
  //
  // submitFileExport() {
  //   this.$refs.upload.submit();
  //   this.fullscreenLoading = true;
  // },

},

};
</script>


<style scoped>

</style>
